﻿
Imports System.Data
Imports VSModel
Imports Cls_Common


Partial Class FrontEnd_Control_PersonalBar
    Inherits System.Web.UI.UserControl

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim lstNode As New DataSet
        lstNode.ReadXml(MapPath("../../xml/PersonalBar.xml"))
        With rptMenu
            .DataSource = lstNode.Tables("Node")
            .DataBind()
        End With
    End Sub

    Protected Sub rptMenu_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles rptMenu.ItemDataBound
        Dim ltrTitle As Literal
        ltrTitle = e.Item.FindControl("ltrTitle")
        If e.Item.DataItem("URL") <> "quan-ly-gio-hang.html" Then
            ltrTitle.Text = "<a href='" & MainDomain & e.Item.DataItem("URL") & "'>" & e.Item.DataItem("Title") & "</a>&nbsp;|&nbsp;"
        Else
            ltrTitle.Text = "<a href='" & MainDomain & e.Item.DataItem("URL") & "'>" & e.Item.DataItem("Title") & "</a>"
        End If
    End Sub

    Protected Sub lbtnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lbtnExit.Click
        Session("UserName") = Nothing
        Session("UserId") = Nothing

        Response.Redirect(MainDomain)
    End Sub
End Class
